Masala #0042
Teskari polyar yozuvi
Qavslar yordamida ifodalangan algebraik ifodani TPY(teskari polyar yozuvi) shakliga o’tkazing. Operatorlar: +, -, *, /, ^, qavslar (). Operandlar: a, b, …, z (faqat harflar). Faqat bitta TPY borligi kafolatlanadi, ya’ni, a*b*c kabi ifodalar yo’q.
INPUT.TXT kirish faylining yagona satrida uzunligi 5000 dan oshmaydigan algebraik ifoda berilgan
OUTPUT.TXT chiqish faylining yagona satrida algebraik ifodaning TPY shaklidagi ifodasini chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
(a+(b*c)) |
abc*+ |
2 |
((a+b)*(z+x)) |
ab+zx+* |